<?php
declare(strict_types=1);
namespace app\admin\controller;
class Doc extends Cp
{
    protected string $model = 'common.doc';
    protected string $order = 'sort ASC,id ASC';
    protected int $bookId = 0;

    public function __construct()
    {
        $this->bookId = input('book_id', 0, 'intval');
        if ($this->bookId == 0) {
            $this->error('非法操作');
        }
        $this->jumpUrl .= '?book_id=' . $this->bookId;
        view_with('book_id', $this->bookId);
    }

    protected function _where(): array
    {
        return ['book_id' => $this->bookId];
    }
}